import { createRouter, createWebHistory } from 'vue-router'
import Layout from "@/layout/Layout";

const routes = [
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    redirect: "/login",
    children: [
      {
        path: 'welcome',
        name: 'welcome',
        component: () => import("@/views/welcome"),
      },
      {
        path:'storeByExpressman',
        name:'storeByExpressman',
        component:()=> import ("@/views/storeByExpressman"),
      },
      {
        path:'queryStoredByExpressman',
        name:'queryStoredByExpressman',
        component:()=> import ("@/views/queryStoredByExpressman"),
      },
      {
        path: 'queryPickedUpByExpressmanAndNoTake',
        name: 'queryPickedUpByExpressmanAndNoTake',
        component: () => import("@/views/queryPickedUpByExpressmanAndNoTake"),
      },
      {
        path:'queryPickedUpByExpressmanAndTake',
        name:'queryPickedUpByExpressmanAndTake',
        component:()=> import ("@/views/queryPickedUpByExpressmanAndTake"),
      },
      {
        path: 'delivery',
        name: 'delivery',
        component: () => import("@/views/delivery"),
      },
      {
        path: 'queryDelivery',
        name: 'queryDelivery',
        component: () => import("@/views/queryDelivery"),
      },
      {
        path:'queryNotTakeAwayByMyself',
        name:'queryNotTakeAwayByMyself',
        component:()=> import ("@/views/queryNotTakeAwayByMyself"),
      },
      {
        path:'queryTakeAwayByMyself',
        name:'queryTakeAwayByMyself',
        component:()=> import ("@/views/queryTakeAwayByMyself"),
      },
      {
        path:'queryFriendRequestNotake',
        name:'queryFriendRequestNotake',
        component:()=> import ("@/views/queryFriendRequestNotake"),
      },
      {
        path:'queryFriendRequestTakeByMyself',
        name:'queryFriendRequestTakeByMyself',
        component:()=> import ("@/views/queryFriendRequestTakeByMyself"),
      },
      {
        path:'queryMyRequestToFriend',
        name:'queryMyRequestToFriend',
        component:()=> import ("@/views/queryMyRequestToFriend"),
      },
      {
        path:'queryData',
        name:'queryData',
        component:()=> import ("@/views/queryData"),
      },
      {
        path:'managerExpressman',
        name:'managerExpressman',
        component:()=> import ("@/views/managerExpressman"),
      },
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import("@/views/Login")
  },
  {
    path: '/register',
    name: 'Register',
    component: () => import("@/views/Register")
  }
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
